package com.sizu.web;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sizu.common.dto.Page;
import com.sizu.common.statisticaldto.TCustomerStatementDto;
import com.sizu.common.vo.ResultEntity;
import com.sizu.entity.TCustomerStatementZyx;
import com.sizu.service.ITCustomerStatementService;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 赵玉玺
 * @since 2020-02-29
 */
@RestController
@RequestMapping("/statistical/tCustomerStatement")
public class TCustomerStatementController {

    @Resource
    private ITCustomerStatementService itCustomerStatementService;

    /**
     * 查询客户统计列表
     * @param tCustomerStatementDto
     * @return
     */
    @RequestMapping("/list")
    public ResultEntity tCustomerStatementList(TCustomerStatementDto tCustomerStatementDto){
        TCustomerStatementZyx tCustomerStatementZyx=new TCustomerStatementZyx();
        BeanUtils.copyProperties(tCustomerStatementDto,tCustomerStatementZyx);
        List<TCustomerStatementZyx> customerStatementList = itCustomerStatementService.getCustomerStatementList(tCustomerStatementZyx);
        return ResultEntity.ok("查询成功",customerStatementList);
    }
}
